function vicAfterUnitCreation(args)
{
    var unit = args.unit;
}

function vicAfterUnitDeath(args)
{
    var unit = args.unit;
}

// returns an array of strings of the unit/structure's skills
function vicGetSkills(unit)
{
if (unit == null) return null;
var isNewFormat = unit.AllFlags.get("add_skills").search(", ") != -1;
var skills = unit.AllFlags.get("add_skills");

if (isNewFormat)
{
skills = skills.split(", ");
}
else
{
skills = skills.replace(/_/g, " ").split(","); // replace underscores and split
}

return skills;
}

// returns a boolean indicating whether a unit/structure is flying, either due to being affected by an effect or the unit having flight specified in its file
function vicIsFlying(unit)
{
if (unit == null) return false;
if (vicDictionaryHasKey(unit.AllFlags, "flying")) return true;

// search through all effects to see if it has 1 granting flight
var effects = unit.Effects;

for (var i=0; i<effects.length; i++)
{
if (vicDictionaryHasKey(effects[i].AllFlags, "fly")) return true;
}
return false;
}